AddCSLuaFile( "cl_init.lua" );
AddCSLuaFile( "shared.lua" );

include( "shared.lua" );

function ENT:Initialize()
	
	self:PhysicsInit( SOLID_VPHYSICS );
	self:SetMoveType( MOVETYPE_VPHYSICS );
	self:SetSolid( SOLID_VPHYSICS );
	
	self:SetModel( "models/props_junk/garbage_takeoutcarton001a.mdl" );
	
	local phys = self:GetPhysicsObject();
	
	if( phys:IsValid() ) then
		phys:Wake();
	end
	
end

function ENT:SetItem( id )
	
	local item = V.I.GetItemByID( id );
	
	self:SetModel( item.Model );
	self:SetSkin( item.Skin );
	
	self.ID = id;
	
end

function ENT:Use( ply )
	
	V.I.GiveItem( ply, self.ID, 1, true );
	self:Remove();
	
end

function ENT:OnTakeDamage( dmg )
	
	self:TakePhysicsDamage( dmg );
	
end